﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="p_tcdc_trn_payment_info.aspx.cs" Inherits="TCDC_System.Content.MasterData.p_tcdc_trn_payment_info" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register TagPrefix="uc" Src="~/UserControl/PaymentInfoAdd.ascx" TagName="PaymentInfoAdd" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script type="text/javascript">
        var exportData = function (GridData, GridPanel) {
            GridData.setValue(Ext.encode(GridPanel.getRowsValues({ selectedOnly: false })));
        };
     </script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="mainResource" runat="server" CleanResourceUrl="false" />
<ext:Hidden ID="GridData" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:GridPanel ID="GridPanelPaymentInfo" runat="server" Region="Center" DDGroup="gridDDGroup" 
     EnableDragDrop="false" StripeRows="true"  Title="PaymentInfo" 
     Icon="Vcard" Frame="true">
     <TopBar>
          <ext:Toolbar ID="Toolbar1" runat="server">
               <Items>
                    <ext:Button ID="btAdd" runat="server" Text="Add" Icon="Add" OnDirectClick="AddPaymentInfo"/>
                    <ext:ToolbarSeparator/>
                    <ext:Button ID="btDelete" runat="server" Text="Delete" Icon="Delete">
                         <DirectEvents>
                              <Click OnEvent="DeletePaymentInfo" > 
                              <EventMask ShowMask="true"/>
                              </Click>
                         </DirectEvents>
                    </ext:Button>
                    <ext:ToolbarSeparator/>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server"/>
                    <ext:Button ID="btExcel" runat="server" AutoPostBack="true" OnClick="ExportExcelPaymentInfo" Text="To Excel" Icon="PageExcel">
                         <Listeners>
                              <Click Handler="exportData(#{GridData},#{GridPanelPaymentInfo});"/>
                         </Listeners>
                    </ext:Button>
               </Items>
          </ext:Toolbar>
     </TopBar>
     <Store>
          <ext:Store runat="server" ID="StorePaymentInfo" OnRefreshData="StorePaymentInfo_Refresh"> 
               <Reader>
                    <ext:JsonReader IDProperty="payment_info_id">
                         <Fields>
                              <ext:RecordField Name="payment_info_id"/>
                              <ext:RecordField Name="invoice_no"/>
                              <ext:RecordField Name="payment_date" Type="Date"/>
                              <ext:RecordField Name="user_id"/>
                              <ext:RecordField Name="payment_name"/>
                              <ext:RecordField Name="payment_address"/>
                              <ext:RecordField Name="province"/>
                              <ext:RecordField Name="post_code"/>
                              <ext:RecordField Name="payment_method"/>
                              <ext:RecordField Name="bank_name"/>
                              <ext:RecordField Name="bank_branch"/>
                              <ext:RecordField Name="budget_year"/>
                              <ext:RecordField Name="payment_no"/>
                              <ext:RecordField Name="cancel_status"/>
                              <ext:RecordField Name="cancel_desc"/>
                              <ext:RecordField Name="create_date" Type="Date"/>
                              <ext:RecordField Name="create_by"/>
                              <ext:RecordField Name="update_date" Type="Date"/>
                              <ext:RecordField Name="update_by"/>
                              <ext:RecordField Name="site_id"/>
                         </Fields>
                    </ext:JsonReader>
               </Reader>
          </ext:Store>
     </Store>
     <ColumnModel>
          <Columns>
               <ext:RowNumbererColumn/>
               <ext:Column Header="payment_info_id" DataIndex="payment_info_id" Width="100" Align="Center"/>
               <ext:Column Header="invoice_no" DataIndex="invoice_no" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField1" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:DateColumn Header="payment_date" DataIndex="payment_date" Width="100" Align="Center" Format="yyyy-MM-dd">
                    <Editor>
                         <ext:DateField ID="TextField2" runat="server" AllowBlank="false" MsgTarget="Side" Format="yyyy-MM-dd"/>
                    </Editor>
               </ext:DateColumn>
               <ext:Column Header="user_id" DataIndex="user_id" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField3" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="payment_name" DataIndex="payment_name" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField4" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="payment_address" DataIndex="payment_address" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField5" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="province" DataIndex="province" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField6" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="post_code" DataIndex="post_code" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField7" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="payment_method" DataIndex="payment_method" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField8" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="bank_name" DataIndex="bank_name" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField9" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="bank_branch" DataIndex="bank_branch" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField10" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="budget_year" DataIndex="budget_year" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField11" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="payment_no" DataIndex="payment_no" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField12" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="cancel_status" DataIndex="cancel_status" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField13" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="cancel_desc" DataIndex="cancel_desc" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField14" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:DateColumn Header="create_date" DataIndex="create_date" Width="100" Align="Center" Format="yyyy-MM-dd">
                    <Editor>
                         <ext:DateField ID="TextField15" runat="server" AllowBlank="false" MsgTarget="Side" Format="yyyy-MM-dd"/>
                    </Editor>
               </ext:DateColumn>
               <ext:Column Header="create_by" DataIndex="create_by" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField16" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:DateColumn Header="update_date" DataIndex="update_date" Width="100" Align="Center" Format="yyyy-MM-dd">
                    <Editor>
                         <ext:DateField ID="TextField17" runat="server" AllowBlank="false" MsgTarget="Side" Format="yyyy-MM-dd"/>
                    </Editor>
               </ext:DateColumn>
               <ext:Column Header="update_by" DataIndex="update_by" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField18" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="site_id" DataIndex="site_id" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField19" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
          </Columns>
     </ColumnModel>
     <Plugins>
          <ext:GridFilters ID="GridFilters1" runat="server" Local="true">
               <Filters>
                    <ext:StringFilter DataIndex="payment_info_id" />
                    <ext:StringFilter DataIndex="invoice_no" />
                    <ext:StringFilter DataIndex="payment_date" />
                    <ext:StringFilter DataIndex="user_id" />
                    <ext:StringFilter DataIndex="payment_name" />
                    <ext:StringFilter DataIndex="payment_address" />
                    <ext:StringFilter DataIndex="province" />
                    <ext:StringFilter DataIndex="post_code" />
                    <ext:StringFilter DataIndex="payment_method" />
                    <ext:StringFilter DataIndex="bank_name" />
                    <ext:StringFilter DataIndex="bank_branch" />
                    <ext:StringFilter DataIndex="budget_year" />
                    <ext:StringFilter DataIndex="payment_no" />
                    <ext:StringFilter DataIndex="cancel_status" />
                    <ext:StringFilter DataIndex="cancel_desc" />
                    <ext:StringFilter DataIndex="create_date" />
                    <ext:StringFilter DataIndex="create_by" />
                    <ext:StringFilter DataIndex="update_date" />
                    <ext:StringFilter DataIndex="update_by" />
                    <ext:StringFilter DataIndex="site_id" />
               </Filters>
          </ext:GridFilters>
          <ext:RowEditor ID="RowEditorPaymentInfo" runat="server" SaveText="Update">
               <DirectEvents>
                    <AfterEdit OnEvent="UpdatePaymentInfo">
                         <ExtraParams>
                              <ext:Parameter Name="PaymentInfoValue" Value="Ext.encode(#{GridPanelPaymentInfo}.getRowsValues({selectedOnly:true}))" Mode="Raw">
                              </ext:Parameter>
                         </ExtraParams>
                         <EventMask ShowMask="true"/>
                    </AfterEdit>
               </DirectEvents>
          </ext:RowEditor>
     </Plugins>
     <SelectionModel>
          <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
     </SelectionModel>
     <LoadMask ShowMask="true" />
     <BottomBar>
          <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="19" DisplayInfo="true" 
              EmptyMsg="No Request to display"/>
     </BottomBar>
</ext:GridPanel>

<ext:Panel ID="PanelSouth" runat="server" Region="South" Split="true" Height="30" Padding="6" Html="" BodyStyle="background-color: #DFE8F6" />
</Items>
</ext:Viewport>
<uc:PaymentInfoAdd ID="PaymentInfoAdd1" runat="server" />

</form>
</body>
</html>

